ListField Property

       

Returns or sets the name of the field in the Recordset object, specified by the RowSource property, used to fill the DataCombo or DataList control's list portion.

Syntax

object.ListField [= value]

The ListField property syntax has these parts:

Part Description
object An object expression that evaluates to an object in the Applies To list.
value A string expression that specifies the name of a field in the Recordset specified by the RowSource property.

Remarks

The ListField property enables you to select which field in the Recordset is used to fill the list portion of the control. This property is used in conjunction with the RowSource property that specifies which Data control is used to create the Recordset used to fill the list.

Generally, you use two Recordset objects with the data-aware list controls. One Recordset contains a read-only list of valid selections, while the other Recordset is updated with selections from the list. For example, the DataList control could be generated from a query that returned a list of valid part numbers and their descriptions. The ListField property would point to the description field of the Recordset, so that the user doesn't see the actual part numbers. The BoundColumn property would point to the part number field, as this is what needs to be updated in the Recordset.

If the field specified by the ListField property can't be found in the Recordset, a trappable error occurs.

Data Type

String